<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
	<title>我的电商首页</title>
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/bootstrap-theme.min.css">
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/style.css">
</head>
<body>
	<div class="container">
		<include file="./Application/Home/View/header.php" />
		<div class="row">
			<div class="col-md-3">
				<div id="menu">
					<div id="menu_title" class="list-group-item">
						<i class="glyphicon glyphicon-menu-hamburger"></i><?=$parent_catalog['name']?>
					</div>
					<ul class="list-group">
						<?php
							foreach ($brother_catalogs as $prca) {
						?>
						<li class="list-group-item <?php if ($catalog['id']==$prca['id']) {?>active<?php }?>"><a href="<?=U('Home/Product/lists/cataid/'.$prca['id'])?>"><?=$prca['name'];?></a></li>
						<?php
							}
						?>
					</ul>
				</div>
			</div>
			<div class="col-md-9">
				<div class="panel panel-default">
					<div class="panel-body">
					<?php foreach ($brands as $br) {?>
						<a class="btn btn-xs <?php if ($brand_id==$br['id']) {?> btn-info active<?php }?>" href="<?=U('Home/Product/lists/cataid/'.$catalog['id']).'?brand='.$br['id']?>"><?=$br['name']?></a>
					<?php }?>
					</div>
				</div>
				<?php foreach ($products as $ps) {?>
				<div class="w25 nrjz pull-left">
					<div class="panel panel-default">
						<div class="panel-body h425">
							<img class="thumbnail product_main_img img170" src="__ROOT__<?=($ps['img'])?>"/>
							<div class="h57">
								<?php $imgs=M("product_img")->where('product_id ='.$ps['id'])->limit(4)->select()?>
								<?php foreach ($imgs as $img) {?>
								<div class="pull-left selectedpic ma-ri5">
									<img class="img37" src="__ROOT__<?=($img['url'])?>"/>
								</div>
								<?php }?>
							</div>
							<div class="panel-body titleh60 h60">
								<a class="panel-title" href="<?=U('Home/Product/detail/id/'.$ps['id'])?>"><b><?=$ps['title']?></b></a>
							</div>
							<div class="panel-body h88">
								<div class="pull-left">价格：</div>
								<div class="text-danger pull-left"><b>¥<?=$ps['price']?></b></div>
								<div>
									<a class="btn btn-danger" href="<?=U('Home/Product/detail/id/'.$ps['id'])?>">立即购买</a>
								</div>
							</div>
						</div>
					</div>
				</div>
				<?php }?>
			</div>
		</div>
	</div>
	<script type="text/javascript" src="__PUBLIC__/js/jquery-3.1.0.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/jquery.elevateZoom-3.0.8.min.js"></script>
	<script type="text/javascript">
		$(function(){
			$('.selectedpic').mouseover(function(){
				$('.selectedpic').removeClass("hover");
				$(this).addClass('hover');
				var src  = $(this).find('img').attr('src');
				$(this).parents('.h425').find('.product_main_img').attr('src',src);
			})
		});
	</script>
</body>
</html>